<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>

  <style>
    .box1{
      width: 100px;
      height: 100px;
      background: red;
      border: 10px solid green;
      box-sizing: border-box;
      margin: 10px auto 10px;
    }

    .box2{
      width: 100px;
      height: 100px;
      background: green;
      border: 10px solid red;
      box-sizing: content-box;
      margin: 10px auto 10px;
    }

    .box3{
      width: 100px;
      height: 30px;
      margin: 20px auto 10px;
      background: blue;
      color: #ffffff;
      text-align: center;
      line-height: 30px;
    }
  </style>

</head>
<body>
  
  <div class="box1"></div>

  <div class="box2"></div>

  <div class="box3">100px</div>
</body>
</html>